﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="Recipe.RecipePage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Recipe"
    xmlns:common="using:Recipe.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">开封菜（KFC）菜谱</x:String>
    </Page.Resources>
    <Page.TopAppBar>
        <AppBar x:Name="topappBar" Padding="5,0,0,0">
            <StackPanel Orientation="Horizontal">
                <Button x:Name="btnHome" HorizontalAlignment="Left" Style="{StaticResource HomeAppBarBtnStyle}" Click="btnHome_Click"/>

            </StackPanel>
        </AppBar>
    </Page.TopAppBar>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid>
        <Grid.Background>
            <ImageBrush ImageSource="images/Background.jpg"/>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="300"/>
                <ColumnDefinition Width="600"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Text="KFC菜谱" Grid.Column="1" Style="{StaticResource PageHeaderTextStyle}"/>

            <StackPanel x:Name="appLogo"  Grid.Column="3" Margin="0,0,53,0" Width="204" Height="88"  HorizontalAlignment="Right" VerticalAlignment="Center">
                <Image Source="images/AppLogo.png" Stretch="Fill" Width="204" Height="88" />
            </StackPanel>
        </Grid>
        <ScrollViewer x:Name="srvMain" Style="{StaticResource HorizontalScrollViewerStyle}" HorizontalAlignment="Left" Margin="0" Grid.Row="1">
            <StackPanel x:Name="contentMain" HorizontalAlignment="Left" Margin="50,0,20,50" Orientation="Horizontal" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <ScrollViewer x:Name="srvShiCai" Height="300" VerticalAlignment="Top" Margin="0" >
                    <StackPanel x:Name="spShiCai" Margin="0" Width="331" VerticalAlignment="Top" ScrollViewer.VerticalScrollBarVisibility="Auto" HorizontalAlignment="Left" d:IsHidden="False">

                    </StackPanel>

                </ScrollViewer>
                <StackPanel  Margin="20,0,0,0" VerticalAlignment="Top" Width="400" HorizontalAlignment="Left" Background="White" d:IsHidden="False">
                    <Image Width="360" Name="imgBig" Margin="10,10,10,10" Source="" Stretch="Uniform"  HorizontalAlignment="Center" VerticalAlignment="Top"/>
                    <TextBlock Name="txtTitle" HorizontalAlignment="Center" Margin="0" TextWrapping="Wrap" Text="" Width="356" VerticalAlignment="Bottom"
                               FontFamily="Segoe UI" FontSize="30" Padding="0" Height="45" FontWeight="SemiLight" Foreground="#FFC94FA2"/>
                    <TextBlock HorizontalAlignment="Left" Height="35" Margin="20.5,0,0,0" TextWrapping="Wrap" Text="简介" Width="265" Foreground="Chocolate" FontFamily="Segoe UI" FontSize="25.333" FontWeight="SemiBold"/>
                    <StackPanel HorizontalAlignment="Left" Height="157" Margin="20,5,0,0" VerticalAlignment="Top" Width="358" Orientation="Horizontal" >

                        <TextBlock Name="txtDescription" Height="157" Width="358" Margin="0" TextWrapping="Wrap" VerticalAlignment="Top"  HorizontalAlignment="Left" FontFamily="Segoe UI" 
                                   FontSize="14.667" FontWeight="SemiLight" LineHeight="25" Foreground="Black">
                        </TextBlock>
                    </StackPanel>
                </StackPanel>
                <StackPanel  Margin="21,0,0,-1" VerticalAlignment="Top" Width="500" HorizontalAlignment="Left" Background="SeaGreen" d:IsHidden="False">
                    <Grid Height="460" Margin="0,20,0,0" HorizontalAlignment="Center" Width="480" VerticalAlignment="Center">
                        <TextBlock Name="txtSteps" HorizontalAlignment="Left" Height="459" Margin="0" TextWrapping="Wrap" VerticalAlignment="Top" Width="480" FontFamily="Segoe UI" FontSize="21.333" FontWeight="SemiBold" Foreground="Wheat">
        				
                            <Run Text="制作："/>
        					<LineBreak/>

                        </TextBlock>
                    </Grid>
                </StackPanel>
                <StackPanel  Margin="21,0,0,-1" VerticalAlignment="Top" Width="500" HorizontalAlignment="Left" Background="SeaGreen" d:IsHidden="True">
                    <Grid Height="459" Margin="0,20,0,0" HorizontalAlignment="Center" Width="480" VerticalAlignment="Center">
                        <TextBlock HorizontalAlignment="Left" Height="459" Margin="0" TextWrapping="Wrap" VerticalAlignment="Top" Width="480" FontFamily="Segoe UI" FontSize="16" FontWeight="Normal" Foreground="White">
                       
                            <Run FontSize="20" FontWeight="Bold" Foreground="Wheat" Text="开封菜(KFC)"/><LineBreak />                           
                            <Run Text="  开封作为宋朝都城，豫菜发源地，饮食文化源远流长，春节食俗也流传至今。春节期间，无论家宴或待客，一般以四凉、四热、四扣碗为主，具有膳食平衡，凸显开封菜五味调和、质味适中的特色。 开封菜作为中原河南菜的一大代表，特点是用料广泛，讲究刀工，五味调和，口感适中。出名的菜肴多与皇帝、名人有关，可见七朝古都的名号的确不是盖的。&quot;开封桶子鸡&quot;，这是豫菜中的千年传统名菜。用多种中药材料和老母鸡卤制而成，据说其中用到的陈年老汤还是特地从开封运来的，原汁原味，所以此菜皮脆肉香，让人回味无穷。"/>
                            <LineBreak />
                            <LineBreak />
                            <Run FontSize="20" FontWeight="Bold" Foreground="Wheat" Text="另外含义KFC"/>
                            <LineBreak />
                            <Run Text="根据《爱呼2——爱情左灯右行》中对开封菜的解释" />
                            <LineBreak />
                            <Run Text="女主角林嘉欣与扮演天使黄渤的对话："/>
                            <LineBreak/>
                            <Run Text="天使黄渤:&quot;唉，我说你这个人也太奇怪了，我刚才跟你说话你不理我，我得走了你又不让我走，我下来一趟不容易啊，我得赶快找到好吃的东西去。唉，对对对，我想起来了，这个地方有个挺好吃的，叫什么开封菜还不错。&quot;"/>
                            <LineBreak />
                            <Run Text="林嘉欣：&quot;开封菜？&quot;"/>
                            <LineBreak/>
                            <Run Text="天使黄渤：&quot;就是一白头发老头做的广告，叫什么KFC，再见再见再见！&quot;..."/>
                        </TextBlock>
                    </Grid>
                </StackPanel>
                <StackPanel  Margin="21,0,0,0" VerticalAlignment="Top" Width="500" HorizontalAlignment="Left" Background="SeaGreen">
                    <Grid Height="500" Margin="0,20,0,0" HorizontalAlignment="Center" Width="500" VerticalAlignment="Center">                      
                        
                        <WebView Name="webView"  Height="480" Width="480"/>
                        
                    </Grid>
                </StackPanel>
            </StackPanel>
        </ScrollViewer>
        <Grid x:Name="grdContent" Grid.Row="0" Grid.RowSpan="2" Visibility="Collapsed">
            <TextBlock Text="Please switch to full screen to view content" Margin="10,0,0,0" FontSize="24" VerticalAlignment="Center" HorizontalAlignment="Center" TextWrapping="Wrap" FontWeight="Bold" Foreground="White"/>
        </Grid>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup>
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentMain" Storyboard.TargetProperty="Margin">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="96,0,10,56"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="appLogo" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="grdContent" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="srvMain" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
